import request from '@/utils/request'

// 部门列表获取
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

// 删除部门  /company/department/{id} DELETE
export function delDepartment(id) {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}

// 新增用户  /company/department
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 编辑部门获取详情 /company/department/{id}
export function getDepartmentDetail(id) {
  return request({
    url: '/company/department/' + id
  })
}

// 编辑部门修改  /company/department/{id}
export function updateDepartment(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}
